package exp.day04;

import java.util.Arrays;
import java.util.Scanner;

//去重排序，从键盘输入若干个数，最后降序输出不重复的数字（用数组实现）
public class Exp01Arr {
    public static void main(String[] args) {
        int[] arr = new int[1];
        int i = 0;
        Scanner cin = new Scanner(System.in);
        while (cin.hasNext()) {
            if (i == arr.length) {
                int[] arr2 = new int[arr.length * 2];
                System.arraycopy(arr, 0, arr2, 0, arr.length);
                arr = arr2;
            }
            arr[i++] = cin.nextInt();
        }
        Arrays.sort(arr,0,i); //将arr[]排序
        System.out.print(arr[i-1]);
        int recent = arr[i-1];
        for (int j = i-2; j >= 0; j--) {
            if (arr[j] == recent) {
                continue;
            }
            System.out.print(" " + arr[j]);
            recent = arr[j];
        }
    }
}
